﻿@using SmartStore.Licensing
@model LicenseLabelModel

@{
	Layout = null;
}

@if (Model.IsLicensable && !Model.HideLabel)
{
	if (Model.LicenseState == LicensingState.Licensed)
	{
		<span class="badge badge-success">@T("Admin.Common.Licensed")</span>
	}
	else if (Model.LicenseState == LicensingState.Unlicensed && Model.TruncatedLicenseKey.HasValue())
	{
		<span class="badge badge-danger">@T("Admin.Common.Unlicensed")</span>
	}
	else
	{
		<span class="badge @(Model.RemainingDemoUsageDaysLabel)">
			@if (!Model.RemainingDemoUsageDays.HasValue)
			{
				@T("Admin.Plugins.LicensingDemoNotStarted")
			}
			else if (Model.RemainingDemoUsageDays <= 0)
			{
				@T("Admin.Plugins.LicensingDemoExpired")
			}
			else
			{
				@T("Admin.Plugins.LicensingDemoRemainingDays", Model.RemainingDemoUsageDays)
			}
		</span>
	}
}